<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {% load staticfiles %}
    <link rel="shortcut icon" href="{% static 'img/logo.ico' %}">
    <title>文章编辑页面</title>
</head>
<body>
<form action="{% url 'blog:edit_action' %}" method="post">
    {% csrf_token %}

    {% if article %}
        <input type="hidden" name="atc_id" value="{{ article.id }}"/>
    <label>标题 &nbsp; &nbsp; &nbsp;
        <input type="text" style="width: 400px" placeholder="请输入文章标题" name="title" value="{{ article.title }}"/>
    </label>
    <br><br>
    <label>内容 &nbsp; &nbsp; &nbsp;
        <textarea placeholder="请输入文章内容"  name="content" style="width: 500px;height: 500px" >{{ article.content }}</textarea>
    </label>
    <br><br>
    <button type="submit" style="width: 200px;background: dodgerblue;color: aliceblue">提交</button>
    {% else %}
        <input type="hidden" name="atc_id" value=0 />
    <label>标题 &nbsp; &nbsp; &nbsp;
        <input type="text" style="width: 400px" placeholder="请输入文章标题" name="title" />
    </label>
    <br><br>
    <label>内容 &nbsp; &nbsp; &nbsp;
        <textarea placeholder="请输入文章内容"  name="content" style="width: 500px;height: 500px" ></textarea>
    </label>
    <br><br>
    <button type="submit" style="width: 200px;background: dodgerblue;color: aliceblue">提交</button>
    {% endif %}
</form>

</body>
</html>